}
for (let i = 0; i < ids.length; i++) {
- let [sessionName, sessionDescription] = Gdm.get_session_name_and_description(ids[i]);
+ let [sessionName, sessionDescription_] = Gdm.get_session_name_and_description(ids[i]);
let id = ids[i];
let item = new PopupMenu.PopupMenuItem(sessionName);
let f = Gio.File.new_for_uri(uri);
try {
- let [ok, bytes] = f.load_contents(null);
+ let [ok_, bytes] = f.load_contents(null);
if (bytes instanceof Uint8Array)
xml = imports.byteArray.toString(bytes);
else
// This function is likely the one you want to call from external modules
function getCompletions(text, commandHeader, globalCompletionList) {
let methods = [];
- let expr, base;
+ let expr_, base;
let attrHead = '';
if (globalCompletionList == null) {
globalCompletionList = [];
// Look for expressions like "Main.panel.foo" and match Main.panel and foo
let matches = text.match(/(.*)\.(.*)/);
if (matches) {
- [expr, base, attrHead] = matches;
+ [expr_, base, attrHead] = matches;
methods = getPropertyNamesFromExpression(base, commandHeader).filter(
attr => attr.slice(0, attrHead.length) == attrHead
// not proceeded by a dot and match them against global constants
matches = text.match(/^(\w*)$/);
if (text == '' || matches) {
- [expr, attrHead] = matches;
+ [expr_, attrHead] = matches;
methods = globalCompletionList.filter(
attr => attr.slice(0, attrHead.length) == attrHead
);
function getDeclaredConstants(str) {
let ret = [];
str.split(';').forEach(s => {
- let base, keyword;
+ let base_, keyword;
let match = s.match(/const\s+(\w+)\s*=/);
if (match) {
- [base, keyword] = match;
+ [base_, keyword] = match;
ret.push(keyword);
}
});
let sessionId = GLib.getenv('XDG_SESSION_ID');
if (!sessionId) {
log('Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.');
- let [session, objectPath] = this._userProxy.Display;
+ let [session, objectPath_] = this._userProxy.Display;
if (session) {
log(`Will monitor session ${session}`);
sessionId = session;
(proxy, result) => {
let fd = -1;
try {
- let [outVariant, fdList] = proxy.call_with_unix_fd_list_finish(result);
+ let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
fd = fdList.steal_fds()[0];
callback(new Gio.UnixInputStream({ fd: fd }));
} catch (e) {
return;
}
- let [status, code, name] = result;
+ let [status_, code, name] = result;
this.operator_name = _findProviderForMccMnc(name, code);
this.emit('notify::operator-name');
});
// it will return an error if the device is not connected
this.operator_name = null;
} else {
- let [bandClass, band, sid] = result;
+ let [bandClass_, band_, sid] = result;
this.operator_name = _findProviderForSid(sid);
}
}
_reloadSignalQuality() {
- let [quality, recent] = this._proxy.SignalQuality;
+ let [quality, recent_] = this._proxy.SignalQuality;
this.signal_quality = quality;
this.emit('notify::signal-quality');
}
// occur when trying to parse or start the program.
function spawnCommandLine(commandLine) {
try {
- let [success, argv] = GLib.shell_parse_argv(commandLine);
+ let [success_, argv] = GLib.shell_parse_argv(commandLine);
trySpawn(argv);
} catch (err) {
_handleSpawnError(commandLine, err);
// Runs @argv in the background. If launching @argv fails,
// this will throw an error.
function trySpawn(argv) {
- var success, pid;
+ var success_, pid;
try {
- [success, pid] = GLib.spawn_async(null, argv, null,
- GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
- null);
+ [success_, pid] = GLib.spawn_async(null, argv, null,
+ GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
+ null);
} catch (err) {
/* Rewrite the error in case of ENOENT */
if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) {
// Runs @commandLine in the background. If launching @commandLine
// fails, this will throw an error.
function trySpawnCommandLine(commandLine) {
- let success, argv;
+ let success_, argv;
try {
- [success, argv] = GLib.shell_parse_argv(commandLine);
+ [success_, argv] = GLib.shell_parse_argv(commandLine);
} catch (err) {
// Replace "Error invoking GLib.shell_parse_argv: " with
// something nicer
function ensureActorVisibleInScrollView(scrollView, actor) {
let adjustment = scrollView.vscroll.adjustment;
- let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
+ let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
let offset = 0;
let vfade = scrollView.get_effect("fade");
}
_onPermStoreChanged(proxy, sender, params) {
- let [table, id, deleted, data, perms] = params;
+ let [table, id, deleted_, data_, perms] = params;
if (table != 'gnome' || id != 'geolocation')
return;
let datastream = Gio.DataInputStream.new(sp.get_stdout_pipe());
while (true) {
- let [line, length] = datastream.read_line_utf8(null);
+ let [line, length_] = datastream.read_line_utf8(null);
if (line === null)
break;
return;
}
- let [handle, appId, parentWindow, title, subtitle, body, options] = params;
+ let [handle, appId, parentWindow_, title, subtitle, body, options] = params;
// We probably want to use parentWindow and global.display.focus_window
// for this check in the future
if (appId && `${appId}.desktop` != this._windowTracker.focus_app.id) {
return false;
this._panning = true;
this._clickAction.release();
- let [dist, dx, dy] = action.get_motion_delta(0);
+ let [dist_, dx_, dy] = action.get_motion_delta(0);
let adjustment = this._adjustment;
adjustment.value -= (dy / this._scrollView.height) * adjustment.page_size;
return false;
}
_onPan(action) {
- let [dist, dx, dy] = action.get_motion_delta(0);
+ let [dist_, dx_, dy] = action.get_motion_delta(0);
let adjustment = this.actor.vscroll.adjustment;
adjustment.value -= (dy / this.actor.height) * adjustment.page_size;
return false;
}
_loadPattern() {
- let colorString, res, color, secondColor;
+ let colorString, res_, color, secondColor;
colorString = this._settings.get_string(PRIMARY_COLOR_KEY);
- [res, color] = Clutter.Color.from_string(colorString);
+ [res_, color] = Clutter.Color.from_string(colorString);
colorString = this._settings.get_string(SECONDARY_COLOR_KEY);
- [res, secondColor] = Clutter.Color.from_string(colorString);
+ [res_, secondColor] = Clutter.Color.from_string(colorString);
let shadingType = this._settings.get_enum(COLOR_SHADING_TYPE_KEY);
if (this._show.get_num_slides() < 1)
return;
- let [progress, duration, isFixed, filename1, filename2] = this._show.get_current_slide(monitor.width, monitor.height);
+ let [progress, duration, isFixed_, filename1, filename2] = this._show.get_current_slide(monitor.width, monitor.height);
this.transitionDuration = duration;
this.transitionProgress = progress;
this._newStylePlugin = authHelper.externalUIMode;
try {
- let [success, pid, stdin, stdout, stderr] =
+ let [success_, pid, stdin, stdout, stderr] =
GLib.spawn_async_with_pipes(null, /* pwd */
argv,
null, /* envp */
_readStdoutOldStyle() {
this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null, (stream, result) => {
- let [line, len] = this._dataStdout.read_line_finish_utf8(result);
+ let [line, len_] = this._dataStdout.read_line_finish_utf8(result);
if (line == null) {
// end of file
message: keyfile.get_string(VPN_UI_GROUP, 'Description'),
secrets: [] };
- let [groups, len] = keyfile.get_groups();
+ let [groups, len_] = keyfile.get_groups();
for (let i = 0; i < groups.length; i++) {
if (groups[i] == VPN_UI_GROUP)
continue;
};
function makeMessageFromTpMessage(tpMessage, direction) {
- let [text, flags] = tpMessage.to_text();
+ let [text, flags_] = tpMessage.to_text();
let timestamp = tpMessage.get_sent_timestamp();
if (timestamp == 0)
}
vfunc_observe_channels(...args) {
- let [account, conn, channels, dispatchOp, requests, context] = args;
+ let [account, conn, channels, dispatchOp_, requests_, context] = args;
let len = channels.length;
for (let i = 0; i < len; i++) {
let channel = channels[i];
- let [targetHandle, targetHandleType] = channel.get_handle();
+ let [targetHandle_, targetHandleType] = channel.get_handle();
if (channel.get_invalidated())
continue;
}
vfunc_handle_channels(...args) {
- let [account, conn, channels, requests, userActionTime, context] = args;
+ let [account, conn, channels, requests_, userActionTime_, context] = args;
this._handlingChannels(account, conn, channels, true);
context.accept();
}
}
_approveTextChannel(account, conn, channel, dispatchOp, context) {
- let [targetHandle, targetHandleType] = channel.get_handle();
+ let [targetHandle_, targetHandleType] = channel.get_handle();
if (targetHandleType != Tp.HandleType.CONTACT) {
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
}
_displayPendingMessages(logManager, result) {
- let [success, events] = logManager.get_filtered_events_finish(result);
+ let [success_, events] = logManager.get_filtered_events_finish(result);
let logMessages = events.map(makeMessageFromTplEvent);
this._ensureNotification();
let current = info;
let infos = [info];
for (let i = 0; i < forecasts.length; i++) {
- let [ok, timestamp] = forecasts[i].get_value_update();
+ let [ok_, timestamp] = forecasts[i].get_value_update();
let datetime = new Date(timestamp * 1000);
if (!_isToday(datetime))
continue; // Ignore forecasts from other days
- [ok, timestamp] = current.get_value_update();
+ [ok_, timestamp] = current.get_value_update();
let currenttime = new Date(timestamp * 1000);
if (currenttime.getHours() == datetime.getHours())
continue; // Enforce a minimum interval of 1h
let col = 0;
infos.forEach(fc => {
- let [ok, timestamp] = fc.get_value_update();
+ let [ok_, timestamp] = fc.get_value_update();
let timeStr = Util.formatTime(new Date(timestamp * 1000), {
timeOnly: true
});
while (target) {
if (target._delegate && target._delegate.handleDragOver) {
- let [r, targX, targY] = target.transform_stage_point(this._dragX, this._dragY);
+ let [r_, targX, targY] = target.transform_stage_point(this._dragX, this._dragY);
// We currently loop through all parents on drag-over even if one of the children has handled it.
// We can check the return value of the function and break the loop if it's true if we don't want
// to continue checking the parents.
while (target) {
if (target._delegate && target._delegate.acceptDrop) {
- let [r, targX, targY] = target.transform_stage_point(dropX, dropY);
+ let [r_, targX, targY] = target.transform_stage_point(dropX, dropY);
if (target._delegate.acceptDrop(this.actor._delegate,
this._dragActor,
targX,
this._loginManager.listSessions(result => {
let n = 0;
for (let i = 0; i < result.length; i++) {
- let [id, uid, userName, seat, sessionPath] = result[i];
+ let [id_, uid_, userName, seat_, sessionPath] = result[i];
let proxy = new LogindSession(Gio.DBus.system, 'org.freedesktop.login1', sessionPath);
if (proxy.Class != 'user')
throw new Error('Missing metadata.json');
}
- let metadataContents, success;
+ let metadataContents, success_;
try {
- [success, metadataContents] = metadataFile.load_contents(null);
+ [success_, metadataContents] = metadataFile.load_contents(null);
if (metadataContents instanceof Uint8Array)
metadataContents = imports.byteArray.toString(metadataContents);
} catch (e) {
}
_computePages(availWidthPerPage, availHeightPerPage) {
- let [nColumns, usedWidth] = this._computeLayout(availWidthPerPage);
+ let [nColumns, usedWidth_] = this._computeLayout(availWidthPerPage);
let nRows;
let children = this._getVisibleChildren();
if (nColumns > 0)
_loadModel(groupName) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/%s.json'.format(groupName));
- let [success, contents] = file.load_contents(null);
+ let [success_, contents] = file.load_contents(null);
if (contents instanceof Uint8Array)
contents = imports.byteArray.toString(contents);
}
_onPan(action) {
- let [dist, dx, dy] = action.get_motion_delta(0);
+ let [dist_, dx, dy_] = action.get_motion_delta(0);
this.delta = this.delta + dx;
if (this._currentKey != null) {
_populateSections() {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/osk-layouts/emoji.json');
- let [success, contents] = file.load_contents(null);
+ let [success_, contents] = file.load_contents(null);
if (contents instanceof Uint8Array)
contents = imports.byteArray.toString(contents);
let threshold = this._lastTime - this._timeout;
while (i < this._barrierEvents.length) {
- let [time, distance] = this._barrierEvents[i];
+ let [time, distance_] = this._barrierEvents[i];
if (time >= threshold)
break;
i++;
let firstNewEvent = i;
for (i = 0; i < firstNewEvent; i++) {
- let [time, distance] = this._barrierEvents[i];
+ let [time_, distance] = this._barrierEvents[i];
this._currentPressure -= distance;
}
*/
setCrosshairsColor(color) {
if (this._crossHairs) {
- let [res, clutterColor] = Clutter.Color.from_string(color);
+ let [res_, clutterColor] = Clutter.Color.from_string(color);
this._crossHairs.setColor(clutterColor);
}
}
}
_centerFromPointProportional(xPoint, yPoint) {
- let [xRoi, yRoi, widthRoi, heightRoi] = this.getROI();
+ let [xRoi_, yRoi_, widthRoi, heightRoi] = this.getROI();
let halfScreenWidth = global.screen_width / 2;
let halfScreenHeight = global.screen_height / 2;
// We want to pad with a constant distance after zooming, so divide
}
_findUrlAtPos(event) {
- let success;
+ let success_;
let [x, y] = event.get_coords();
- [success, x, y] = this.actor.transform_stage_point(x, y);
+ [success_, x, y] = this.actor.transform_stage_point(x, y);
let findPos = -1;
for (let i = 0; i < this.actor.clutter_text.text.length; i++) {
- let [success, px, py, lineHeight] = this.actor.clutter_text.position_to_coords(i);
+ let [success_, px, py, lineHeight] = this.actor.clutter_text.position_to_coords(i);
if (py > y || py + lineHeight < y || x < px)
continue;
findPos = i;
_imageForNotificationData(hints) {
if (hints['image-data']) {
let [width, height, rowStride, hasAlpha,
- bitsPerSample, nChannels, data] = hints['image-data'];
+ bitsPerSample, nChannels_, data] = hints['image-data'];
return Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
bitsPerSample, width, height, rowStride);
} else if (hints['image-path']) {
}
_notifyForSource(source, ndata) {
- let [id, icon, summary, body, actions, hints, notification] =
+ let [id_, icon, summary, body, actions, hints, notification] =
[ndata.id, ndata.icon, ndata.summary, ndata.body,
ndata.actions, ndata.hints, ndata.notification];
}, class PadDiagram extends St.DrawingArea {
_init(params) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/pad-osd.css');
- let [success, css, etag] = file.load_contents(null);
+ let [success_, css] = file.load_contents(null);
if (css instanceof Uint8Array)
css = imports.byteArray.toString(css);
this._curEdited = null;
for (let i = 0; i < this._labels.length; i++) {
let [label, action, idx, dir] = this._labels[i];
- let [found, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
+ let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
this._allocateChild(label, x, y, arrangement);
}
if (this._editorActor && this._curEdited) {
- let [label, action, idx, dir] = this._curEdited;
- let [found, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
+ let [label_, action, idx, dir] = this._curEdited;
+ let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
this._allocateChild(this._editorActor, x, y, arrangement);
}
}
if (str != null) {
label.set_text(str);
- let [found, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
+ let [found_, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
this._allocateChild(label, x, y, arrangement);
}
label.show();
} else if (event.get_source_device() == this.padDevice &&
event.type() == Clutter.EventType.PAD_STRIP) {
if (this._editionMode) {
- let [retval, number, mode] = event.get_pad_event_details();
+ let [retval_, number, mode] = event.get_pad_event_details();
this._startStripActionEdition(number, UP, mode);
}
} else if (event.get_source_device() == this.padDevice &&
event.type() == Clutter.EventType.PAD_RING) {
if (this._editionMode) {
- let [retval, number, mode] = event.get_pad_event_details();
+ let [retval_, number, mode] = event.get_pad_event_details();
this._startRingActionEdition(number, CCW, mode);
}
}
gicon = Gio.icon_new_for_string(meta['gicon']);
} else if (meta['icon-data']) {
let [width, height, rowStride, hasAlpha,
- bitsPerSample, nChannels, data] = meta['icon-data'];
+ bitsPerSample, nChannels_, data] = meta['icon-data'];
gicon = Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
bitsPerSample, width, height, rowStride);
}
return;
if (this._lockScreenGroup.y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) {
// Complete motion automatically
- let [velocity, velocityX, velocityY] = this._dragAction.get_velocity(0);
+ let [velocity_, velocityX_, velocityY] = this._dragAction.get_velocity(0);
this._liftShield(true, -velocityY);
} else {
// restore the lock screen to its original place
if (!screenshot)
return;
screenshot.pick_color(...coords, (o, res) => {
- let [success, color] = screenshot.pick_color_finish(res);
+ let [success_, color] = screenshot.pick_color_finish(res);
let { red, green, blue } = color;
let retval = GLib.Variant.new('(a{sv})', [{
color: GLib.Variant.new('(ddd)', [
}
_onPan(action) {
- let [dist, dx, dy] = action.get_motion_delta(0);
+ let [dist_, dx_, dy] = action.get_motion_delta(0);
let adjustment = this._scrollView.vscroll.adjustment;
adjustment.value -= (dy / this.actor.height) * adjustment.page_size;
return false;
if (_modes.hasOwnProperty(modeName))
return;
- let fileContent, success, newMode;
+ let fileContent, success_, newMode;
try {
- [success, fileContent] = file.load_contents(null);
+ [success_, fileContent] = file.load_contents(null);
if (fileContent instanceof Uint8Array)
fileContent = imports.byteArray.toString(fileContent);
newMode = JSON.parse(fileContent);
}
function _onPopup(actor, entry) {
- let [success, textX, textY, lineHeight] = entry.clutter_text.position_to_coords(-1);
+ let [success, textX, textY_, lineHeight_] = entry.clutter_text.position_to_coords(-1);
if (success)
entry.menu.setSourceAlignment(textX / entry.width);
entry.menu.open(BoxPointer.PopupAnimation.FULL);
* attempt went wrong.
*/
AskPasswordAsync(params, invocation) {
- let [id, message, iconName, defaultUser, defaultDomain, flags] = params;
+ let [id, message, iconName, defaultUser_, defaultDomain_, flags] = params;
if (this._setCurrentRequest(invocation, id, ShellMountOperationType.ASK_PASSWORD)) {
this._dialog.reaskPassword();
let childToShow = null;
if (this._standard.visible && this._alternate.visible) {
- let [x, y, mods] = global.get_pointer();
+ let [x_, y_, mods] = global.get_pointer();
let altPressed = (mods & Clutter.ModifierType.MOD1_MASK) != 0;
if (this._flipped)
childToShow = altPressed ? this._standard : this._alternate;
// details.) So we check now. (Have to do this after updating
// selection.)
if (this._modifierMask) {
- let [x, y, mods] = global.get_pointer();
+ let [x_, y_, mods] = global.get_pointer();
if (!(mods & this._modifierMask)) {
this._finish(global.get_current_time());
return false;
_keyReleaseEvent(actor, event) {
if (this._modifierMask) {
- let [x, y, mods] = global.get_pointer();
+ let [x_, y_, mods] = global.get_pointer();
let state = mods & this._modifierMask;
if (state == 0)
let adjustment = this._scrollView.hscroll.adjustment;
let [value] = adjustment.get_values();
let [absItemX] = this._items[index].get_transformed_position();
- let [result, posX, posY] = this.transform_stage_point(absItemX, 0);
+ let [result_, posX, posY_] = this.transform_stage_point(absItemX, 0);
let [containerWidth] = this.get_transformed_size();
if (posX + this._items[index].get_width() > containerWidth)
this._scrollToRight();
_scrollToLeft() {
let adjustment = this._scrollView.hscroll.adjustment;
- let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
+ let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
let item = this._items[this._highlighted];
_scrollToRight() {
let adjustment = this._scrollView.hscroll.adjustment;
- let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
+ let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
let item = this._items[this._highlighted];
return;
}
- let [clone, overlay] = this._addWindowClone(win, false);
+ let [clone, overlay_] = this._addWindowClone(win, false);
if (win._overviewHint) {
let x = win._overviewHint.x - this.actor.x;
}
_activateThumbnailAtPoint(stageX, stageY, time) {
- let [r, x, y] = this.transform_stage_point(stageX, stageY);
+ let [r_, x_, y] = this.transform_stage_point(stageX, stageY);
for (let i = 0; i < this._thumbnails.length; i++) {
let thumbnail = this._thumbnails[i];
}
_onPan(action) {
- let [dist, dx, dy] = action.get_motion_delta(0);
+ let [dist_, dx, dy] = action.get_motion_delta(0);
let adjustment = this._scrollAdjustment;
if (global.workspace_manager.layout_rows == -1)
adjustment.value -= (dy / this.actor.height) * adjustment.page_size;
while (pickedActor) {
if (pickedActor._delegate && pickedActor._delegate.handleDragOver) {
- let [r, targX, targY] = pickedActor.transform_stage_point(x, y);
+ let [r_, targX, targY] = pickedActor.transform_stage_point(x, y);
let result = pickedActor._delegate.handleDragOver(this,
dragEvent.dragActor,
targX,